<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <p:dialog header="Adauga/Editeaza studii" widgetVar="add_education_WV" dynamic="true"
              minHeight="300" width="600"
              modal="true">

        <h:form id="create_education_form">

            <h:panelGrid columns="2" columnClasses="column-1, column-200" styleClass="form-elements">
                <p:outputLabel for="education_institution" value="Institutia de invatamant:"/>
                <p:inputText id="education_institution" value="#{skillsDataBean.selectedEducation.institutionName}"
                             required="true"/>

                <p:outputLabel for="education_types" value="Tip studii:"/>
                <p:selectOneMenu id="education_types" value="#{skillsDataBean.selectedEducation.educationType}"
                                 required="true" style="width: 200px;"
                                 converter="#{objectMappingConverter}">
                    <f:selectItem itemLabel="Selectati ..."/>
                    <f:selectItems var="et" value="#{skillsDataBean.educationTypes}" itemLabel="#{et.name}"
                                   itemValue="#{et}"/>
                </p:selectOneMenu>

                <p:outputLabel for="education_domains" value="Domeniu studii:"/>
                <p:selectOneMenu id="education_domains" value="#{skillsDataBean.selectedEducation.educationDomain}"
                                 required="true" style="width: 200px;"
                                 converter="#{objectMappingConverter}">
                    <f:selectItem itemLabel="Selectati ..."/>
                    <f:selectItems var="ed" value="#{skillsDataBean.educationDomains}" itemLabel="#{ed.name}"
                                   itemValue="#{ed}"/>
                </p:selectOneMenu>

                <p:outputLabel for="education_speciality" value="Specialitatea:"/>
                <p:inputText id="education_speciality" value="#{skillsDataBean.selectedEducation.specialty}"
                             required="true"/>

                <p:outputLabel for="graduation_year" value="Anul absolbirii:"/>
                <p:inputText id="graduation_year" value="#{skillsDataBean.selectedEducation.graduationYear}"
                             required="true"/>

                <p:outputLabel for="is_basic" value="Studii de baza:"/>
                <p:selectBooleanCheckbox id="is_basic" value="#{skillsDataBean.selectedEducation.basic}"/>
            </h:panelGrid>
            <p:outputPanel layout="block" style="border-top: 1px solid #A8A8A8; padding: 5px;">
                <p:commandButton icon="ui-icon-disk" value="Salveaza"
                                 update="@form :folder_details_content:folder_details_content:educations_form"
                                 actionListener="#{skillsDataBean.saveEducation}"
                                 oncomplete="if (args &amp;&amp; !args.validationFailed) add_education_WV.hide()"/>
                <p:commandButton value="Renunta" onclick="PF('add_education_WV').hide();" process="@none"/>
            </p:outputPanel>
        </h:form>
    </p:dialog>


</ui:composition>
